
package com.ruoyi.dataserver.line.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OperationSymbolEnum {

    EQ("EQ","=","="),
    NE("NE","!=","!="),
    GT("GT",">",">"),
    LT("LT","<","<"),
    GE("GE",">=",">="),
    LE("LE","<=","<="),
    LIKE("LIKE","LIKE","LIKE %%")
    ;


    private String code;
    private String operationSymbol;
    private String description;

    public static OperationSymbolEnum getOperationSymbolEnumWithCode(String code){
        if (code == null || code.isEmpty()){
            return null;
        }
        for (OperationSymbolEnum operationSymbolEnum : OperationSymbolEnum.values()) {
            if (code.equals(operationSymbolEnum.getCode())){
                return  operationSymbolEnum;
            }
        }
        return null;
    }
}